package cz.muni.fi.pa165.library.api;

import java.io.Serializable;

/**
 * This entity represents a reader. It's attributes are first name, surname,
 * birth number, address, email and telephone number (the last is not required).
 *
 * @author Matúš Abaffy
 */
public class ReaderTO implements Serializable {

    private static final long serialVersionUID = 1L;
    private Long id;
    private String firstName;
    private String surname;
    private String birthNumber;
    private String address;
    private String email;
    private String telephoneNumber;
    private String password;
    public ReaderTO() {
    }

    public ReaderTO(String firstName, String surname, String birthNumber,
            String address, String email, String telephoneNumber, String password) {
        this.firstName = firstName;
        this.surname = surname;
        this.birthNumber = birthNumber;
        this.address = address;
        this.email = email;
        this.telephoneNumber = telephoneNumber;
        this.password= password;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getSurname() {
        return surname;
    }

    public void setSurname(String surname) {
        this.surname = surname;
    }

    public String getBirthNumber() {
        return birthNumber;
    }

    public void setBirthNumber(String birthNumber) {
        this.birthNumber = birthNumber;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getTelephoneNumber() {
        return telephoneNumber;
    }

    public void setTelephoneNumber(String telephoneNumber) {
        this.telephoneNumber = telephoneNumber;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ReaderTO)) {
            return false;
        }
        ReaderTO other = (ReaderTO) object;
        if ((this.id == null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "name: " + firstName + " " + surname;
    }
}
